<template>
  <div>
    <div v-if="Object.keys(list).length">
      <LoginFunctionality :list="list" :token="token"></LoginFunctionality>
      <ProjectFeatures></ProjectFeatures>
    </div>
    <PageLoading v-else></PageLoading>
  </div>
</template>

<script>
import LoginFunctionality from '@/components/mine/LoginFunctionality.vue'
import ProjectFeatures from '@/components/mine/ProjectFeatures.vue'
import PageLoading from '@/components/public/PageLoading.vue'
import { userProfile } from '@/api/article'
import { getToken } from '@/utils/storage'

export default {
  name: 'mine-page',
  components: {
    LoginFunctionality,
    ProjectFeatures,
    PageLoading
  },
  async created () {
    this.token = await getToken()
    const data = await userProfile()
    this.list = data.body
  },
  data () {
    return {
      list: {},
      token: ''
    }
  }
}
</script>

<style lang="less" scoped></style>
